Trip Sections and Positions in Trips
Characteristic
Short description
Trip section numbers and positions in trips are tools for the user to specify positions of stops at customer sites within a trip.
Use
Examples for scenarios that can be modeled by trip section numbers:
- Some stops may be added to a given tour. They may be added only at the end of a tour. E.g.:
- Set tripSectionNumber of customer sites of given tour to 1.
- Set tripSectionNumber of customer sites that have to be added to 2.
- After automatic planning, the planner wants deliveries at customers to be before pickups at customers. E.g.:
- Set tripSectionNumber of delivery customer sites to 1.
- Set tripSectionNumber of pickup customer sites to 2.
- You may have to duplicate a customer site if it is used both, for pickup and delivery.
- Some customers are promised to be visited early in the trip. E.g.:
- Set tripSectionNumber of customer sites that have to be visited early to 1.
- Set tripSectionNumber of all other customer sites to 2.
Examples for scenarios that can be modeled by positions in trips:
- A certain extraordinary customer site must be the first customer of a trip.
- Set positionInTrip of this customer site to FIRST_CUSTOMER_STOP.
- A certain extraordinary customer site must be the last customer of a trip.
- Set positionInTrip of this customer site to LAST_CUSTOMER_STOP.
Detailed Consideration
The customer stop sequence within a trip can be influenced in the following way:
- A stop at a customer site with a specified trip section number will always be after other stops (within the same trip) with a specified lower trip section number.
- A stop at a customer site with a specified trip section number will always be before other stops (within the same trip) with a specified higher trip section number.
- A stop at a customer site with position in trip of type FIRST_CUSTOMER_STOP will always be the very first customer stop in its trip.
- A stop at a customer site with position in trip of type LAST_CUSTOMER_STOP will always be the very last customer stop in its trip.
Example for valid positions of customer stops within a trip
What can be seen here:
- Customer sites without specified trip section number are not considered for the trip section restriction.
- Customer sites with specified trip section number must have a non-decreasing trip section number within a trip, but
- they can be equal (e.g. 1 ➞ 1 is allowed)
- they do not have to be subsequent (e.g. 1 ➞ 5 is allowed).
- A customer site with specified position in trip of type FIRST_CUSTOMER_STOP has to be the very first customer stop within the trip but depot stop(s) can precede within the same trip.
Example for valid positions of customer stops within each trip of a multi-trip scenario
What can be seen here:
- Trip section and position in trip restrictions consider each trip separately, even if there are multiple trips in one tour (see Tours and Trips), i.e.:
- A trip can have a stop at a customer site with a lower trip section number than a previous stop in a previous trip (e.g. 5 (Trip "A")➞...➞ 1 (Trip "B") is allowed).
- A customer stop with position in trip of type LAST_CUSTOMER_STOP can be the last customer stop of the trip without being the last customer stop of the tour (analogously for case FIRST_CUSTOMER_STOP).
-
Customer sites with the same trip section number can be in different trips (e.g. trip section number 1 in Trip "A" as well as in Trip "B" is ok).
To specify sites that shall be planned within the same trip, order groups can be defined for the respective orders.
Example for invalid trip sections within a trip
A customer site has a lower specified trip section number than the customer site of a previous stop within the same trip.
A position violation of type TRIP_SECTION will occur for all tour events at this stop.
Example for invalid first position of customer stop within a trip
A customer site with specified position in trip of type FIRST_CUSTOMER_STOP is not the very first customer stop in its trip.
A position violation of type CUSTOMER_STOP_POSITION_IN_TRIP will occur for all tour events at this stop.
What can be seen here:
- A customer site with position in trip of type FIRST_CUSTOMER_STOP must be the very first customer stop of the trip. Thus, a customer stop before a customer stop with position in trip of type FIRST_CUSTOMER_STOP within the same trip is never allowed, no matter which attributes the previous stop has (i.e. even if neither a trip section number nor a position in trip is defined). This holds analogously for case LAST_CUSTOMER_STOP.
Example for invalid last position of customer stop within a trip
A customer site with specified position in trip of type LAST_CUSTOMER_STOP is not the very last customer stop in its trip.
A position violation of type CUSTOMER_STOP_POSITION_IN_TRIP will occur for all tour events at this stop.
What can be seen here:
- A customer site with position in trip of type LAST_CUSTOMER_STOP must be the very last customer stop of the trip. Thus, a customer stop after a customer stop with position in trip of type LAST_CUSTOMER_STOP within the same trip is never allowed, no matter which attributes the next stop has (i.e. even if the position in trip is also of type LAST_CUSTOMER_STOP). This holds analogously for case FIRST_CUSTOMER_STOP.
Good to know
Usage per customer site.
Trip section numbers and positions in trips cannot be set both at the same customer site.
Otherwise an InvalidRequestException is thrown.
It is valid to set none of the two values.
In this case, no particular restriction concerning its customer stop position is implied by this site.
Violations
Trip section numbers and positions in trips are hard restrictions.
I.e., an input tour which does not fulfill these restrictions will be marked as violated.
A violated tour will not be changed during optimization.
Related Topics
Technical Concept | Tours and Trips |
Technical Concept | Order Groups |